SURVIVAL Version 6.1.3 © M. URRUTIA AVISRROR (1996). UNIVERSITY OF SALAMANCA - DEPARTAMENT OF UROLOGY SALAMANCA - SPAIN ===================================================== WELCOME TO SURVIVAL: To run the application you need at least a LC Mac or a higher model with a FPU (or the Pseudo-FP INIT) with a gray or Color Monitor. We firmly recommend to use System 7.xx and a minimum of 4 megabytes of RAM. This module allows the user to easily estimate survival functions from censored data and to assess the relationship between survival and a set of both continuous and categorical variables, known as covariates or prognostic factors. Version 6.1.2 also includes survival regression analysis with Exponential, Weibull and Log-Normal models. Main features of Survival include: •Cox's regression analysis with both fixed and time dependent covariates. •Survival regression analysis with Exponential, Weibull and Log-Normal parametric Models. •A Text Editor with all the possibilities of edition found in commercial modules •A Macro Option which permits the on-line transformation of data and the on-line computation of the value of Time Dependent covariates. It also includes different statistical macros to compute descriptive statistics, to perform chi-square and Student T Tests and to estimate exact probabilities for the Normal, F, T and Chi-Square distributions. •Internal transformation of categorical variables into Indicator Variables or Deviation Contrast Variables. •Graph plots for all functions, which may be saved as Pict files or Printed •A powerfull macro-language for on-line transformation of DataArray in memory and to perform fully automated Survival Analysis. •A survival chart option to estimate the probability of survival of a given patient as a function of a user-defined covariate pattern. • If the Option key is pressed while launching the application, a macro file is loaded in memory and the macro located in second position in the macro menu is automatically executed. The first position is left to allow the user to define a function for time-dependent survival analysis. The file should be named 'Survival Macros' and must be located in the same folder than the application. If you don't press the Option key the file is just loaded to be used from the Macros Menu This option allows to link Survival with your current database for fully automated survival analysis. • Now the full manual is included in a Help file which is accessed with the Help item from the Apple Menu. You can make a Hardcopy with the Print option of the File Menu. • To see the latest changes read the file named 'SurvivalLastChanges.txt' after you download a new version. THE OUTPUT OF THE PROGRAM INCLUDES • PARAMETERS FOR THE SURVIVAL MODEL • - Estimated maximum likelihood coefficients for the variables in the model - Estimated standardized coefficients. - Chi-Square Test (Wald) on the statistical significance of the estimated coefficients, with exact probabilities. - Odds-Ratio. - First Derivative of the objective function at convergence. - Global Chi-Square Test. - Likelihood Ratio Test. - Wald Test. - Estimated asymptotic covariance matrix. - Basal Survival Function (Kaplan-Meier) and Survival Function for a given set of covariates (includes density function, hazard function and the standard deviation for cumulative survival). - Maximum Likelihood estimations for the Scale (location) and Shape (scale) parameters of paramateric survival models. • GRAPHICAL OUTPUT ( IN COLOR, GRAY OR BLACK AND WHITE) • - Basal (Kaplan-Meier) and Model survival function plots - Log of -Log of Survival function, for a graphical test of proportionality. - Residual Plots, for a graphical test of goodness of fit of data to model. - I.C. (95% and 99%) plots of the cumulative survival function. - Plot of Hazard, CumHazard and Log of Survival Function vs. Time and Log Time, to assess the fitting of observed data to parametric models. •• DESCRIPTION OF MENU COMMANDS •• • APPLE MENU • ABOUT .... Description on Survival Version and available memory • HELP. Shows this Help Window. If you press the Option key down while selecting this item a window with a description of the available Macro Commands is displayed instead. • FILE MENU • NEW Creates a new Text window than can be edited and saved as a Text File • OPEN Opens a Text file for Editing. • GET DATA. This command shows a dialog box with two options: • TEXT FILE. Data to be analyzed is in a text file (may be exported from another application) where each column represents a variable and each row an observation or case. Column fields may be delimited by tabs or commas • APPLICATION FILE. Data is in a custom binary file created with the SAVE DATA OPTION as APPLICATION FILE of the FILE MENU. • CLOSE. Closes the selected window. If the window is an active window and you have made changes, you are requested to save the changes with a dialog box. This is ignored if you press the Option key down while selecting the item or clicking the close box. • SAVE TEXT. Save the content of Text Windows. If the selected window is a Graphical one, a dialog box with an error message is displayed. • SAVE DATA. Like the GET DATA option, you may save the data loaded in the active output window as a Tab delimited Text File or a Binary Application File. • PAGE SETUP . Shows a dialog box with the printing options for the selected printer. • PRINT. Prints the content of the active Text Window or Plot Window. Notice that plots of graphical windows saved as PICT files may be edited with different graphical programs that accept this format (NIH-Image, EXCEL, etc). You may have problems when printing the Plot window with some Image Writer drivers. • REVERT DATA. Restores the last loaded data in the activa data array. Usefull when data has been changed with the different macro commands. If you want to fix the changes issue a FIXDATA macro from the Macro Command Window. • QUIT. Closes the application. If you have modified your text windows, you are requested to save the changes with a dialog box. •• EDIT MENU •• Needs no further explanation if you are a Mac User. (for PC users converted to the FAITH and TRUTH, read any Macintosh Manual) •• SURVIVAL MENU •• • MODEL. When you select this submenu command a dialog box (a big one) is shown, where you must select the different options of the test. If you don't have an active output window with loaded data, you are warned with an error message. -On the right side there's a box with different CONTROL PARAMETERS: • Status. Put here the column number of the data file where the status variable is located (1 = dead, 0 = censored). Defaults to the first column. • Time. Put here the column number of the data file where the survival times are located. Defaults to the second column. We recommend to use of days as Time Unit for further transformation in weeks, months or years. • Group. Only for stratified analysis. Put the maximum number of strata andthe column number where grouping variable is located (VAR box). Defaults to one group. See macros for additional information on how to use this option. • CutPoint. If you want to make an analysis dividing the total data into two groups by a given cut-point value of a variable, put here the value followed by the column number where the variable is located (VAR box). • Fail Code. You usually should code the status of your observations as 1 for failed and as 0 for censored. If you have different code numbers for this variable, put here the number corresponding to the end of the event to be analyzed. Internally, the program transforms this value to 1's and the other values to 0's. • Iterations. Maximum number of iterations for the Newton-Raphson algorithm. Defaults to 15. In most cases, 4 or 6 iterations are enough to achieve convergence. If not, suspect of multicolineality. If you select the Parametric Analysis option its value is changed to 30 • Precision. Level of precision wanted in the estimation of the coefficients of the Model. Defaults to 0.000001 On the left side of the dialog Box there are two boxes. The one on the left, lists in a scrolling window (as VAR1, VAR2, etc.) the variables in the data file that were loaded with the GET DATA Command. To Select the variables that should be included in a given model, double click with the mouse on the corresponding variable. The selected variable will be displayed on the box to the right. If you want to tell the program that the selected variable should be dealt as a TIME DEPENDENT covariate, press first the OPTION key on the Keyboard.The variable shows with an asterisk (*) on its rightmost side. You may combine in a model both fixed and time dependent covariates. If you are not happy about the variables you selected, you may clear the variables box by selecting with the mouse the CLEAR button. If you don't select any variable a Kaplan-Meier product limit estimator will be computed. This estimator is used for the program as the arbitrary basal function to assess the effect of the covariates included in a given model upon death rates. • Other options in the dialog box control the survival Time Units; the Output of the different numerical functions; Graphical Plots; Labeling of the selected variables; Labeling of Groups; and Graph Title. If you want a printout in black and white check the Use Line Patterns option. (The different groups are identified by lines with different shade patterns in the survival plots). Notice that if you select the time unit to be in weeks, months or years, it is supposed that survival times in your database are recorded in days for subsequent transformation. Otherwise you should use your original time unit with the CUSTOM box selected in the TIME UNITS pop-up menu. • You may also enter the value of the coefficients for estimation of the survival function, provided they have been previously estimated, by checking the USER COEFFICIENTS radio button. • Select the USER COVARIATE PATTERN to estimate the survival function for a given covariate set. A dialog box is diplayed for this purpose. If you select any variable as categorical the 'Enter Covariate Pattern' dialog box is displayed after the transformation process into new indicator or deviation variables has been completed. • if the CONTROL key is pressed while selecting a covariate in the variable window of the DEFINE MODEL dialog box a (c) sign appears in the rightmost side of the variable in the model window. This ENABLES the internal transformation of categorical variables into k-1 INDICATOR or DEVIATION variables, where k is the max number of categories of the selected variable. If you want to use the DEVIATION coding scheme, uncheck the USE INDICATOR VARIABLES box. • You may obtain the same results with the TRANSFORM option of the MODEL menu but you have to manually include the different variables in the model. In the output window the coefficients are labeled as VAR1-1, VAR1-2, etc. or as NAME-1, NAME-2, NAME-3 .. etc if you previously checked the LABEL VARIABLES option. • Check the PROPORTIONALITY TEST box for a quick test to assess if a given covariate that you want to introduce in a model fullfills the proportio- nality assumption. You must select only a single variable with the Time Dependent option (Option key down) **** VERY IMPORTANT **************************************** All the variables selected as categorical (Control Key Down) must be done in ASCENDING ORDER. If you try to select,for example, variable 6 if you previously selected a variable whose column number es equal or less than variable 6 the program beeps, the model window will be CLEARED and You'll have to start the variables selection again. This rule is also applied when in a model you combine categorical with non-categorical variables. Non-categorical variables alone may be selected in any order ***** SURVIVAL ANALYSIS WITH PARAMETRIC MODELS ********* The use of the parametric analysis option is strightforward: • Define your model as in any Cox regression analysis. You may use all the available options, such as transforming categorical variables, labeling variables, user defined covariate patterns, initial value estimate for the coefficients, etc. etc. with the only exception of stratified anlysis. • Check the Use Parametric Model option • After clicking the OK button you`ll be presented with a dialog box with the different options for the parametric analysis. • Select the model that best fits your data. For version 6.1.2 Exponential, Weibull and Log-Normal Models are available If you don't select any covariate the program computes the Scale and Shape ML Estimates for the null model. A Goodness of Fit Test is available only for Exponential and Weibull survival models. • Since parametric analysis usually needs a constant term the CONSTANT TERM option is default; otherwise you should enter as a variable of the model a full column with 1's. This option is unchecked when you don't select any covariate. If you check it, the program computes the scale and shape parameters through the constant and sigma terms. For location-scale models the shape parameter = 1/sigma and the scale parameter is equal to exp(-constant). Both results should be the same. In exponential models the sigma term = 1. When this option is checked the program adds internally a new column with 1's for you to the data array in memory. • Use the CENTER COVARIATE option if you have convergence problems. This option substracts the jth covariate value at the ith survival time from its mean value.The final value of the coefficientes remain unaltered but you'll notice a slight change in the value of the constant term. • Check the PRINT ITERATIONS if you want to print all the iteration process to the active Output Window • Check the PLOT CUMULTATIVE DISTRIBUITON box if you want a Plot of the cumulative distribution F(t) insted of the Survival Fuction S(t) in a parametric regression model. • By Deafult the intial estimate for the Sigma term is = 1: Initial estimates for the Scale and Shape parameters for the null model are 0 and 0.1 respectively. Normally this values should not be changed unless you have convergence problems. ************************************************** • ESTIMATE. This option starts the computation of MLE's and Survival Functions. If you have not previously selected the MODEL option you're warned with an error message. • CLEAR OUTPUT WINDOW. Clears the Text in the output window. You should use this option after saving the results of a Test. Avoid to fill the output window with Text because it slows down the performance of the program. This is specially critical with System 6.xx versions. • OUTPUT FORMAT. Shows a dialog box where you can edit the length and the number of digits after the decimal point for both numerical output and Data listing. • OUTPUT OPTIONS. This is a hierarchical menu with five different options: • SAVE MODEL. Saves the Kaplan-Meier estimate and the coefficients of the Model that will be used with the SURVIVAL CHART option. If you press the Option Key down, the survival function adjusted for the effect of the covariates included in the Model will be saved instead and will be used by the SURVIVAL CHART option as the base-line function until you define and save another Model. • SAVE BASAL FUNCTIONS. Saves the different baseline (Kaplan-Meier) survival functions. If you press the Option key down while selecting the two last items a header with the name of the columns or groups are also saved. In Parametric analysis it saves the survival function for the null model • SAVE MODEL FUNCTIONS. Saves the survival functions after adjusting for the effect of the covariates included in the model. If you press the Option key down while selecting the two last items a header with the name of the columns or groups are also saved. • MACRO MESSAGE . This itme toggles on (checked) and off (unchecked) the message that some macros display on the active Outpu Window after the requested action has been successfully performed (otherwise you'll get an error message). These Macros are SORTBY, FIXDATA, REVERT, SELECTIF, OMITIF, COUNTIF and SAVETEST. The default is on • LANGUAGE. This item has a hierarchical menu with two options. If you select Spanish the numerical results of the test, all graphical Plots, Menus and Dialog boxes legends and warning messages are displayed in Spanish. Macro commands are not changed and should always be entered in English. • TRANSFORM.This option internally transforms categorical variables into either Indicator variables or variables coded according to the Deviation Contrast scheme. If you want another category (defaults to the first value) as reference, change its value in the dialog box before double-clicking on the variable to be transformed. • LIST DATA. List the variables from the active data file in the output window. • SURVIVAL CHART. This option graphically estimates the probability of survival for a patient based on: 1) a previously saved model; 2) an user-defined baseline survival function and 3) an user entered covariate pattern. The program loads first the basal survival function and the values of the coefficients of the previously saved model. An error message is displayed if no model data has been saved or the model data is at a different Volume or Folder. When you select this option the first time the overlay plot option box appears dimmed. After you click the New Chart button another dialog box is displayed requesting the user to enter the covariates values for the current survival chart. The final plot shows the Baseline survival function and the survival function adjusted for the previously entered covariate values. If you select again the Survival Chart item from the Model menu, this time the Overlay Plot option is activated. Notice that you may identify the survival function to be ploted by checking the Label Plot box. If you press the Option key down while slecting this option the plots are displayed with dashed lines to identify the groups insted of colors. I've added the Overlay Plot option so you can show in a single plot the baseline survival function against different levels of the covariates, for comparative and illustrative purposes. •TEST OF HYPOTHESIS. Performs a Wald Test for a subset of variables in the model. It helps to assess the statistical significance of a group o variables while keeping constant the effect of the remaining variables, e.g. when you recode a categorical variable into k-1 Indicator variables and want to assess the joint effect of the different categories. •• GRAPH MENU •• • WHITE/BLACK BACKGROUND. Changes the background color of the Plot window to either white or black. • SAVE GRAPH PLOT. Saves the active Plot Window in standard PICT II format. • SEPARATE PLOTS.This option shows the base line survival survival function and the model survival function in a different plot window. • LOGLOG PLOT. Plot of Log(-Log) of Survival Function. Currently used to Test the proportionalty assumption • RESIDUALS PLOT. Plot of Cumulative Hazard function of Residuals against residuals itself. Useful to assess the goodness of fit of data to model. In Parametric Analysis with Exponential and Weibull this option plots the residuals against the standart exponential order statistics • INTERVALS PLOT [95% and 99%]. Plot of 95% and 99% confidence interval limits for the Kaplan-Meier estimate or the survival function for the null model in parametric analysis. • LOG AND LIN FUNCTIONS PLOT. Helps to graphically assess the fit of your data to parametric models. •• MACRO MENU •• • EDIT MACRO Opens a dialog box to select the macro file you want to edit. If you press the Cancel button an empty Macro Window is shown. Use the SAVE TEXT command of the FILE MENU to save changes. You're also requested to save changes when you close the window. • INSERT MACRO Inserts a New Macro file at the end of the MACRO MENU. If a macro file has different macro definitions every macro is listed as a different item of the MACRO MENU. To execute a macro just select the item with the mouse from the MACRO MENU. To use macros with the Time Dependent Option you should INSERT a macro file with a single macro definition before running the Test; otherwise an error message is shown. (see example the 'Survival Macros' file) • DELETE MACRO Deletes a previously inserted macro file from the MACRO MENU. • RUN MACRO Executes the macro defined in the active Macro Window or the first macro listed in the MACRO MENU. •• WINDOW MENU •• • MACRO COMMAND shows a dialog box with a text edit field, where you can enter any of the Custom Commands listed in the Macro Commands Help Window. Use a semmicolon as delimiter if you use different commands in a single string. The max length of the string is 255 characters. The program adds internally a dummy macro definition so yo don't need to open a Macro window to execute the command. When you issue a Macro Command all macros Inserted in the Macro Window are cleared. Every time you open a Data Window or a Text Window, its name is appended to the window menu from where you can select it. Useful to easily access a given window when you have multiple windows in your desktop. -------------------------------------------------------------------------- SURVIVAL IS PUBLIC DOMAIN AND ITS ONLY PURPOSE IS TO DIVULGE THIS EXCELENT STATISTICAL TOOL AND MAKE IT EASY TO BOTH CLINICAL AND NON CLINICAL INVESTIGATORS WHO WANT TO APPLY THIS METHOD ON THEIR INVESTIGATION WORK. PLEASE FEEL FREE TO GIVE A COPY OF THE PROGRAM TO ANY PERSON CONCERNED WITH SURVIVAL ANALYSIS. •If you use Survival and want to make and acknowledgment, please use the following reference: Urrutia Avisrror, M. Estadistica multivariante en la Investigacion Urologica (III): Analisis de Supervivencia (Editorial). (1989). Act. Urol.Esp, 323-327. ••••• PLEASE REPORT ANY BUG, PROBLEM OR COMMENT TO •••• 1) MANUEL URRUTIA AVISRROR, M.D. P.h. D. Hospital Universitario de Salamanca Department of Urology Paseo San Vicente s/n 37007 SALAMANCA - ESPAÑA 2) MANUEL URRUTIA AVISRROR, M.D. P.h. D. Calle Perdices 53 Urbanización Valdelagua 37191 SALAMANCA-ESPAÑA 3) email Internet:urrutia@gugu.usal.es